home *** CD-ROM | disk | FTP | other *** search
Wrap
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>[EasyPHP] - Administration</title> <style type="text/css"> .text1 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #CCCCCC} .text2 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #999999} .titre1 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #FFFFFF} </style> </head> <body bgcolor="#505F70" vlink="#CCCCCC" alink="#CCCCCC" link="#CCCCCC"> <? if (isset($HTTP_GET_VARS)){ while(list($name, $value) = each($HTTP_GET_VARS)){ $$name = $value; } } if (!isset($to)) $to = ''; if (!isset($ext)) $ext = ''; if (!isset($ext)) $do = ''; if (!isset($ext)) $directory = ''; ?> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr valign="bottom"> <td> <div align="left"> <img src="images_easyphp/easyphp_anim.gif" width="69" height="23" align="absbottom"></div> </td> </tr> </table> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div align="center"><img src="images_easyphp/barre_blanche_700.gif" width="700" height="6"></div> </td> </tr> <tr> <td> <div align="center"><img src="images_easyphp/barre_grise_700.gif" width="700" height="12"></div> </td> </tr> </table> </td> </tr> </table> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div align="right"><img src="images_easyphp/administration.gif" width="141" height="13"></div> </td> </tr> </table> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td nowrap valign="top" class="titre1" rowspan="3"> <img src="images_easyphp/carre_gris.gif" width="8" height="8"> Vos alias : </td> <td valign="top" width="100%" colspan="2"> <? function read_alias(){ global $alias, $directory, $httpd_1, $httpd_2, $httpd_3, $nb_alias, $source; $source = "../apache/conf/httpd.conf"; $fp = fopen($source, "r"); while (!feof($fp)){ $conf = fgets($fp, 4096); $httpd = $httpd.$conf; } fclose($fp); $exp1 = explode("#alias",$httpd); $httpd_1 = $exp1[0]; $httpd_2 = $exp1[1]; $httpd_3 = $exp1[2]; $exp2 = explode("Alias",$httpd_2); $n = 1; while($exp2[$n]){ $exp3 = explode("<Directory",$exp2[$n]); $alias[$n] = "Alias".$exp3[0]; $directory[$n] = "<Directory".$exp3[1]; $n++; } $nb_alias = $n-1; } if ($to == "add_alias_1"){ ?> <form method="post" action="index.php"> <span class=text1> Les alias permettent de placer vos développements dans un ou plusieurs répertoires</span> <br> <span class=text1> indépendamment du répertoire racine d'apache (www).</span> <br><br> <span class=text2> 1. </span> <span class=text1>créer votre répertoire (ex.: C:\weblocal\sites\site1)</span> <br> <span class=text2> 2. </span> <span class=text1>saisir un nom pour l'alias (ex.: site1)</span> <br> <input type="text" name="alias_name" size="60"> <br> <span class=text2> 3. </span> <span class=text1>saisir le chemin du répertoire créé (ex.: C:\weblocal\sites\site1)</span> <br> <input type="text" name="alias_link" size="70"> <br> <span class=text2> 4. </span> <span class=text1>paramètres par défaut du répertoire</span> <br> <textarea name="dir" cols="65" rows="8" wrap="virtual">Options Indexes FollowSymLinks Includes AllowOverride All #Order allow,deny Allow from all </textarea> <br> <span class=text2> 5. </span> <span class=text1>valider</span> <br> <span class=text2> 6. </span> <span class=text1>deux cas :</span> </td> </tr> <tr> <td> </td> <td> <span class=text1> - si "prise en compte automatique des modifications de configuration d'apache" est coché : <br> attendre quelques secondes que le point rouge se remette à clignoter (apache et mysql en vert dans le statut) <br> - si "prise en compte automatique des modifications de configuration d'apache" n'est pas coché : <br> appuyer sur redémarrer et attendre quelques secondes que le point rouge se remette à clignoter (apache et mysql en vert dans le statut) </span> </td> </tr> <tr> <td colspan="2"> <br> <input type="hidden" name="to" value="add_alias_2"> <input type="submit" value="valider"> <a href="javascript:history.back()"><img src="images_easyphp/bouton_retour_form.gif" width="51" height="24" border="0" align="absbottom"></a> </form> <span class=text2>rq : </span> <span class=text1>il existe une copie de secours du fichier httpd.conf dans le rÈpertoire "safe" : httpd-safe.conf</span> <? }else{ if ($to == "add_alias_2"){ if ($alias_name == "" | $alias_link == "" | !is_dir($alias_link)){ if ($alias_name == ""){echo "<span class=text1> ï le champ 2 est vide.</span><br>";} if ($alias_link == ""){echo "<span class=text1> ï le champ 3 est vide.</span><br>";} if ($alias_link != "" & !is_dir($alias_link)){echo "<span class=text1> ï le répertoire correspondant au chemin que vous avez saisi n'existe pas.</span><br>";} echo "<span class=text1> [ <a href=\"javascript:history.back()\" class=\"text2\">retour</a> ]</span></td></tr></table>"; clearstatcache(); exit; }else{ read_alias(); $dir = ereg_replace("\r\n","\n",$dir); $alias_link = stripslashes($alias_link); $alias_link = str_replace("\\","/", $alias_link); if (substr($alias_link, -1) == "/"){$alias_link = substr($alias_link,0,strlen($alias_link)-1);} $new_alias = "Alias \"/"; $new_alias .= $alias_name; $new_alias .= "/\" \""; $new_alias .= $alias_link; $new_alias .= "/\"\n"; $new_alias .= "<Directory \"$alias_link\">\n".$dir."</Directory>\n\n"; $conf = $httpd_1."#alias".$httpd_2.$new_alias."#alias\n".$httpd_3; $fp2 = fopen($source, "w"); fputs($fp2,$conf); fclose($fp2); } } if ($to == "del_alias"){ read_alias(); $conf_del_alias = $httpd_1."#alias\n"; $x = 1; while($x<=$nb_alias){ if ($x != $num_alias){ $conf_del_alias = $conf_del_alias.$alias[$x].$directory[$x]; } $x++; } $conf_del_alias = $conf_del_alias."#alias\n".$httpd_3; $fp3 = fopen($source, "w"); fputs($fp3,$conf_del_alias); fclose($fp3); } read_alias(); $inc = 1; while($inc <= $nb_alias){ $exp4 = explode("\"",$alias[$inc]); $exp5 = explode("/",$exp4[1]); $alias_link = $exp4[3]; $alias_name = $exp5[1]; echo "<span class=\"text1\">"; echo " <img src=\"images_easyphp/dossier_alias.gif\" width=\"15\" height=\"12\"> "; echo "<a href=\"../$alias_name/\" target=\"_blank\">$alias_name</a> [ $alias_link ] "; echo "[ <a href=\"index.php?to=del_alias&num_alias=$inc\" class=text2>supprimer</a> ]<br>"; echo "</span>"; $inc++; } echo "<span class=text1>"; echo " <img src=\"images_easyphp/dossier_alias.gif\" width=\"15\" height=\"12\"> "; echo "... "; echo "[ <a href=\"index.php?to=add_alias_1\" class=text2>ajouter</a> ]<br>"; echo "</span>"; } ?> </td> </tr> </table> <br> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td nowrap valign="top" class="titre1" rowspan="3"> <img src="images_easyphp/carre_gris.gif" width="8" height="8"> Données MySQL (datadir) : </td> <td valign="top" width="100%" colspan="2"> <? function read_myini(){ global $path_datadir,$fp,$default_datadir; $source = "../easyphp.ini"; $fp = @fopen($source, "r"); if ($fp) { while (!feof($fp)){ $ligne = fgets($fp, 4096); $prefixe = substr($ligne,0,6); if ($prefixe == "Windir"){ $split = explode("=",$ligne); $windir = $split[1]; $windir = ereg_replace("\n","",$windir); } if ($prefixe == "datadi"){ $split = explode("=",$ligne); $default_datadir = $split[1]; $default_datadir = ereg_replace("\n","",$default_datadir); $default_datadir = addslashes($default_datadir); } } fclose($fp); }else{ echo "easyphp.ini est necessaire !!!<br>"; } $fp = @fopen($windir."/my.ini", "r"); if ($fp) { while (!feof($fp)){ $ligne = fgets($fp, 4096); $prefixe = substr($ligne,0,7); if ($prefixe == "datadir"){ $split = explode("=",$ligne); $path_datadir = "\"".$split[1]."\""; } } fclose($fp); } } if ($to == "datadir_1"){ read_myini(); ?> <script language="JavaScript"> function defaut() { var legende = ("<? echo $default_datadir; ?>") document.forms[0].new_path_datadir.value = legende } </script> <form method="post" action="index.php"> <span class=text1> Les bases de données sont contenues par défaut dans le répertoire data de</span> <br> <span class=text1> MySQL (ex.: "C:\Program Files\EasyPHP\mysql\data").</span> <br> <span class=text1> Vous pouvez modifier ce répertoire</span> <br><br> <span class=text2> 1. </span> <span class=text1>créer un nouveau répertoire</span> <br> <span class=text2> 2. </span> <span class=text1>copier les bases de données dans le nouveau répertoire</span> <br> <span class=text2> 3. </span> <span class=text1>modifier le chemin pour qu'il corresponde au nouveau répertoire</span> <br> <input type="text" name="new_path_datadir" size="45" value=<? echo $path_datadir; ?>> <span class=text1>[ </span><a href="#" onclick="defaut()" class=text2>répertoire par défaut</a><span class=text1> ]</span> <br> <span class=text2> 4. </span> <span class=text1>valider</span> <br> </td> </tr> <tr> <td valign="top"><span class=text2> 5. </span> </td> <td> <span class=text1> appuyer sur redémarrer et attendre quelques secondes que le point rouge se remette à clignoter (apache et mysql en vert dans le statut) </span> </td> </tr> <tr> <td colspan="2"> <br> <input type="hidden" name="to" value="datadir_2"> <input type="submit" value="valider"> <a href="javascript:history.back()"><img src="images_easyphp/bouton_retour_form.gif" width="51" height="24" border="0" align="absbottom"></a> </form> <span class=text2>rq : </span> <span class=text1>il existe une copie de secours du fichier my.ini dans le rÈpertoire "safe" : my-safe.ini</span> <? }else{ if ($to == "datadir_2"){ if ($new_path_datadir == "" | !is_dir($new_path_datadir)){ if ($new_path_datadir == ""){echo "<span class=text1> ï vous n'avez pas saisi de chemin.</span><br>";} if ($new_path_datadir != "" & !is_dir($new_path_datadir)){echo "<span class=text1> ï le répertoire correspondant au chemin que vous avez saisi n'existe pas.</span><br>";} echo "<span class=text1> [ <a href=\"javascript:history.back()\" class=\"text2\">retour</a> ]</span></td></tr></table>"; clearstatcache(); exit; }else{ $source = "../easyphp.ini"; $fp = @fopen($source, "r"); if ($fp) { while (!feof($fp)){ $ligne = fgets($fp, 4096); $prefixe = substr($ligne,0,6); if ($prefixe == "Windir"){ $split = explode("=",$ligne); $windir = $split[1]; $windir = ereg_replace("\n","",$windir); } } fclose($fp); }else{ echo "easyphp.ini est necessaire !!!<br>"; } $fp = fopen($windir."/my.ini", "r"); while (!feof($fp)){ $ligne = fgets($fp, 4096); $prefixe = substr($ligne,0,7); if ($prefixe == "datadir"){ $split = explode("=",$ligne); $path_datadir = $split[1]; $new_path_datadir = stripslashes($new_path_datadir); $ligne = $split[0]."=".$new_path_datadir."\n"; } $new_myini = $new_myini.$ligne; } //$new_myini = stripslashes($new_myini); //$new_myini = str_replace("\"","", $new_myini); fclose($fp); $fp = fopen($windir."/my.ini", "w+"); fputs($fp,$new_myini); fclose($fp); } } read_myini(); if ($fp){ echo "<span class=\"text1\">"; echo " répertoire actuel : $path_datadir "; echo "[ <a href=\"index.php?to=datadir_1\" class=text2>modifier</a> ]<br>"; echo "</span>"; }else{ echo "<span class=text1> pas de myini</span><br>"; } } ?> </td> </tr> </table> <br> <table width="701" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td colspan="2" class=titre1> <img src="images_easyphp/carre_gris.gif" width="8" height="8"> Administrez vos bases de données : </td> </tr> <tr> <td rowspan="3"> </td> <td width="100%" class=text1> <div align="center">Cliquez sur le bouton ci-dessous pour accéder à l'administration des bases de données.</div> </td> </tr> <tr> <td rowspan="2"> <div align="center"><a href="/mysql/" target="_blank"><img src="images_easyphp/bouton_phpmyadmin.gif" width="106" height="20" border="0"></a></div> </td> </tr> <tr> </tr> <tr> <td colspan="2" class=titre1> <img src="images_easyphp/carre_gris.gif" width="8" height="8"> Environnement EasyPHP :</td> </tr> <tr> <td> </td> <td class=text1> <div align="center">Ces pages vous informeront sur le bon fonctionnement de PHP, sa configuration et sur les éléments installés.<br> <br> </div> </td> </tr> <tr> <td> </td> <td> <div align="center"> <a href="index.php?to=phpinfo"><img src="images_easyphp/bouton_infosphp.gif" width="69" height="16" border="0"></a> <a href="index.php?to=ext"><img src="images_easyphp/bouton_extensions.gif" width="80" height="16" border="0"></a> <a href="index.php?to=mdp"><img src="images_easyphp/bouton_parametres.gif" width="85" height="16" border="0"></a> <a href="index.php"><img src="images_easyphp/bouton_retour.gif" width="51" height="16" border="0"></a></div> </td> </tr> <tr> <td> </td> <td> <div align="center"> <hr width="500"> </div> </td> </tr> </table> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div align="left"> </div> </td> <td class=text1> <? if ($to=="ext") { $extensions = @get_loaded_extensions(); echo "<center>Gestion des extensions : vous avez ".count($extensions)." extensions chargées</center><br>"; @sort($extensions); foreach($extensions as $extension) { echo " <img src=\"images_easyphp/carre_rouge.gif\" width=\"5\" height=\"5\"> $extension <a href=\"index.php?to=ext&ext=$extension\" class=text2>listes des fonctions</a><br>\n"; if ($extension==$ext) { $functions = @get_extension_funcs($ext); @sort($functions); foreach($functions as $function) { print " $function<br>\n"; } } } } elseif ($to=="phpinfo") { ?> </td> </tr> </table> <br> <? phpinfo(); } elseif ($to=="mdp") { echo "Paramètres par défaut de la base de données :<br>"; echo " serveur : \"localhost\"<br>"; echo " username : \"root\"<br>"; echo " mot de passe : \"\"<br>"; }else{ ?> Bienvenue dans votre environnement EasyPHP.<br> Si vous voyez cette phrase, PHP fonctionne. Pour vérifier le fonctionnement de MySQL, vous pouvez accéder au centre d'administration : "PhpMyAdmin".<br> Si vous rencontrez des problèmes, reportez vous au site d'EasyPHP : <a href="http://www.easyphp.org">www.easyphp.org</a><br> <?php } ?> </td> </tr> </table> <table width="700" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div align="center"> </div> </td> </tr> <tr> <td><img src="images_easyphp/barre_grise_700.gif" width="700" height="12"></td> </tr> </table> </body> </html>